package com.tjetc.utils;

import java.util.Random;

/**
 * @Author: itda
 * @Date: 2024/5/16 19:57
 * @Description: RandomCodeUtil
 */
public class RandomCodeUtil {
    public static String getRandomNumber(Integer num) {
        String base = "0123456789";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < num; i++) {
            int number = random.nextInt(base.length());
            sb.append(base.charAt(number));
        }
        return sb.toString();
    }
}
